package com.grm.common.exception;

import com.grm.common.enums.ErrorEnum;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class BusinessException extends RuntimeException
{
    private int code;
    private String message;

    public BusinessException(ErrorEnum errorEnum){
        this.code = errorEnum.getCode();
        this.message = errorEnum.getMessage();
    }

    public BusinessException(String message){
        this.code = 500;
        this.message = message;
    }
}
